{% extends "base.html" %}

{% block title %}WingSDK 测试平台 - new test api{% endblock %}

{% block head %}
<meta name="viewport" content="width=device-width" />
    <script src="../static/jquery-1.12.4.js"></script>
    <script src="../static/scripts/util/init.js"></script>
    <script src="../static/scripts/util/util.js"></script>
    <script src="../static/scripts/api_new/test_api_new.js"></script>

    <script src="../static/bootstrap-3.3.7-dist/dist/js/bootstrap.js"></script>
    <link href="../static/bootstrap-3.3.7-dist/dist/css/bootstrap.css" rel="stylesheet" />

    <script src="../static/bootstrap-table-develop/dist/bootstrap-table.js"></script>
    <link href="../static/bootstrap-table-develop/dist/bootstrap-table.css" rel="stylesheet" />
    <script src="../static/scripts/util/jquery.validate.min.js"></script>

{% endblock %}

{% block content %}
    <div class="panel-body" style="padding-bottom:0px;">
        <h1 style="text-align:center">新增接口</h1>
        <div class="form-group">
        <input type="text" class="form-control required" id="paraList" name="paraList"
                           placeholder="请输入参数URL">
        <button id="btn_copy" type="button" class="btn btn-default" onclick="readPara();">读取</button>
        </div>
        <div class="form-horizontal">
              <div class="form-group">
                <label for="name" class="col-sm-2 control-label">名称</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control required" id="name" name="name"
                           placeholder="请输入接口用例名称">
                </div>
            </div>
		    <div class="form-group">
                <label for="description" class="col-sm-2 control-label">描述</label>
                    <div class="col-sm-10">
                        <input type="longtext" class="form-control" id="description" name="description"
                               placeholder="请输入描述">
                    </div>
            </div>
            <div class="form-group">
                <label for="product" class="col-sm-2 control-label">所属产品</label>
                    <div class="col-sm-10">
                        <input type="longtext" class="form-control" id="product" name="product"
                               placeholder="请输入所属产品">
                    </div>
            </div>
            <div class="form-group">
                <label for="description" class="col-sm-2 control-label">模块</label>
                    <div class="col-sm-10">
                       <input type="text" class="form-control required" id="module" name="module"
                           placeholder="请输入接口所属模块">
                    </div>
            </div>
            <div class="form-group">
                <label for="url" class="col-sm-2 control-label">接口地址</label>
                    <div class="col-sm-10">
                       <input type="text" class="form-control required" id="url" name="url"
                           placeholder="请输入接口所属模块">
                    </div>
            </div>
            <div class="form-group">
                <label for="osignList" class="col-sm-2 control-label">签名参数</label>
                    <div class="col-sm-10">
                       <input type="text" class="form-control required" id="osignList" name="osignList"
                           placeholder="请输入接口签名参数列表">
                    </div>
            </div>
            <div class="form-group">
                    <label for="tb_para" class="col-sm-2 control-label">参数列表</label>
                    <div class="col-sm-10">
                        <table id="tb_para" class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                     <th class="hidden-phone">字段名称</th>
                                     <th class="hidden-phone">默认值</th>
                                     <th class="hidden-phone">是否参数化</th>
                                     <th class="hidden-phone">默认参数名</th>
                                </tr>
                          </thead>
                         <tbody id="para_table">
                        </table>

                    </div>
            </div>
        </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button id="submitButton" class="btn btn-default" onclick="addApiNew();">保存</button>
                    <button id="btn_back" type="button" class="btn btn-default" onclick="window.location.href=('/test_api_new')">返回</button>
                    </div>
            </div>

<style>
.error{
	color:red;
}
</style>
        </div>
    </div>
{% endblock %}